/**
 * @description: 「添加标签」弹窗组件
 * @author: Ruan Jiazhen
 * @date: 2024-03-12 13:50:46
 **/

Component({
  data: {
    isShow: false,
    tag: '',
  },
  methods: {
    open() {
      this.setData({
        isShow: true,
      });
    },
    close() {
      this.setData({
        tag: '',
        isShow: false,
      });
    },
    onClose() {
      this.close();
    },
    onInput(e: WechatMiniprogram.Input) {
      this.setData({
        tag: e.detail.value.trim(),
      });
    },
    onClickConfirm() {
      this.triggerEvent('confirm', { value: this.data.tag });
      this.close();
    },
  },
});
